package com.calligraphy.order.exception;

import com.calligraphy.order.enums.ResultEnum;
import lombok.Getter;

/**
 * @Author hy
 * @Date 2019/1/4 10:28
 **/
@Getter
public class OrderException extends RuntimeException {

    private Integer code;

    public OrderException(Integer code, String message) {
        super(message);
        this.code = code;
    }

    public OrderException(ResultEnum resultEnum) {
        super(resultEnum.getMessage());
        this.code = resultEnum.getCode();
    }
}
